package com.esyoga.yoyoga.handler;

import com.esyoga.yoyoga.pojo.TTrainer;
import com.esyoga.yoyoga.service.CoachDataService;
import lombok.Data;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Data
@Controller
@RequestMapping("/CoachData")
public class CoachDataHandler {

    @Resource
    private CoachDataService coachDataService;

    @RequestMapping("/showData")
    @ResponseBody
    //展示个人信息
    public List<TTrainer> showData(Integer tId) {

        return coachDataService.showData(tId);
    }


    //修改个人信息
    @RequestMapping("/updateData")
    @ResponseBody
    public int updateData(Integer tId, TTrainer tTrainer) {

        return coachDataService.updateData(tId, tTrainer);
    }

}